cmake_minimum_required(VERSION 3.20)
project(mygit)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
set(CMAKE_CXX_STANDARD 17)

# 设置可执行文件的输出路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY test_dir)
# 头文件搜索路径
include_directories(${PROJECT_SOURCE_DIR}/include)

# 获取所有源文件列表
file(GLOB_RECURSE SOURCES "src/*.cpp" "include/*.hpp" "test/*.cpp")

# 定义 PROJECT_NAME 宏并传递给编译器
add_compile_definitions(PROJECT_NAME="${PROJECT_NAME}")

# 添加可执行文件
add_executable(${PROJECT_NAME} ${SOURCES})

# 链接库
target_link_libraries(${PROJECT_NAME} -lcrypto -lgtest_main -lgtest)